#include <bits/stdc++.h>

using namespace std;
const int maxn=1001;
int main_1092()
{
    char owner_beads[maxn],eva_beads[maxn];
    scanf("%s%s",owner_beads,eva_beads);
    int len1=strlen(owner_beads),len2=strlen(eva_beads);
    unordered_map<char,int> beads_cnt1,beads_cnt2;
    for (int i=0; i<len1 ; ++i )
    {
        beads_cnt1[owner_beads[i]]++;
    }
    for (int j=0; j<len2 ; ++j )
    {
        beads_cnt2[eva_beads[j]]++;
    }
    int num=0;
    bool isYes=true;
    for (unordered_map<char,int>::iterator it=beads_cnt2.begin(); it!=beads_cnt2.end() ; ++it )
    {
        if (beads_cnt1[it->first]<it->second)
        {
            isYes=false;
            num+=(it->second)-beads_cnt1[it->first];
        }
    }

    if (isYes)
    {
        printf("Yes %d",len1-len2);
    }
    else
    {
        printf("No %d",num);
    }
    return 0;
}
